package com.atguigu.zy.interview.juc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author : Jungle
 * @Description :
 */
@AllArgsConstructor
public enum StatusEnum {
    ONE_THREAD(1, "A"),
    TWO_THREAD(2, "B"),
    THREE_THREAD(3, "C");
    @Getter
    private Integer retCode;
    @Getter
    private String retMes;

    public static StatusEnum forEach_StatusEnum(int index) {
        StatusEnum[] elements = StatusEnum.values();
        for (StatusEnum element : elements) {
            if (element.retCode == index) {
                return element;
            }
        }
        return null;
    }

}
